import axios from '@/libs/api.request'

export const getRolesList = (seachParams) => {
  return axios.request({
    url: 'roles',
    method: 'get',
    params: seachParams
  })
}

export const getRole = (id) => {
  return axios.request({
    url: 'roles/' + id,
    method: 'get'
  })
}

export const addRole = (data) => {
  return axios.request({
    url: 'roles',
    method: 'post',
    data: data
  })
}

export const updateRole = (id, data) => {
  return axios.request({
    url: 'roles/'+id,
    method: 'put',
    data: data
  })
}

export const deleteRole = (id) => {
  return axios.request({
    url: 'roles/'+id,
    method: 'delete'
  })
}
